Knockout groups are used by a computing device to create graphical effects (e.g., “see-through” text) as part of rendering digital content. Objects that are members of a knockout group are rendered by the computing device such that the appearance of objects in the background that are overlapped by the objects in the knockout group is obscured, i.e., “knocked-out”. Thus, objects in a knockout group do not permit visibility of objects in the background when rendered by a computing device that lie underneath the knockout group. This is in contrast to a transparency compositing model, where partially transparent objects permit visibility of background objects.
An object in a knockout group that completely covers, spatially, a pixel is rendered to obscure each object in the background of that same pixel. However, if the object in the knockout group partially covers a pixel, spatially, then the object only partially knocks-out background objects that share the same pixel. This means, for example, that when rendered by a computing device, an object in a knockout group that spatially covers 30% of a pixel contributes 30% of that pixel's color value. The remaining 70% of the pixel's color value originates from objects in the background. However, the actual amount of color from the object and the background depends on the rendering techniques employed.
Alpha Is Shape (AIS) is used to support increased functionality as part of a knockout group to permit opacity of objects within a knockout group, which is referred to as “opacity coverage” in the following discussion. AIS is typically implemented as a Boolean flag that when turned on, causes objects within a knockout group bearing this flag to composite differently as compared to the case when AIS is off. FIG. 2 depicts examples of image rendering inside a knockout group with and without enabling AIS functionality. The left-hand side of FIG. 2 shows how a digital image is rendered when AIS is off, while the right-hand side shows a result of rendering of the same digital image when AIS is on. In the left-hand side in which AIS is off, the pixels of each of the ovals are completely opaque (having alpha equal to 1) and thus are rendered in a z-order (i.e., depth) such that the right oval completely obscures the left oval within the knockout group. In the right-hand side in which AIS is on, alpha also defines coverage (i.e., “shape”) at each of the pixels, which is this case is an amount of opacity at each pixel. This is referred to as “opacity coverage” of a pixel by an object, i.e., an amount that the object is considered “see through.” As a result, the pixels that form the overlapping portion between the ovals are partially opaque and thus permit at least a portion of the underlying oval to be viewed through the overlapping oval. Thus, AIS may be used to expand how objects are rendered as part of a knockout group by a computing device by addressing “opacity coverage” in addition to spatial coverage.
Conventional techniques that are implemented in GPUs for rendering knockout groups rely on MSAA (multi-sampled anti-aliasing). With MSAA, each pixel is separated into multiple sub-pixels (typically eight sub-pixels). The knockout spatial resolution is therefore limited to the number of such sub-pixels. In other words, if a sub-pixel is partially covered (spatially) by an object in a knockout group, then the sub-pixel is treated as fully covered and each of the objects underneath the sub-pixel are “knocked-out.” Sub-pixels that are not covered by an object in a knockout group continue to show colors from objects underneath when rendered by a computing device. An increase to the number of sub-pixels under MSAA improves the resolution, but at the expense of increased memory usage and processing time.
Some conventional multi-sampling techniques use a depth buffer to maintain Z-ordering among objects in knockout groups. Maintenance of a Z-order supports a knockout requirement that each object inside a knockout group composites with the group's initial backdrop rather than the objects underneath. By maintaining Z-order, such knockout techniques require a GPU to track spatial pixel coverage of objects and knockout groups. Consequently, use of multi-sampling and a depth buffer has performance and memory implications making these conventional techniques inefficient when rendering complicated artwork. These performance implications are more pronounced while rendering content in CMYK color space which inherently requires more memory than in an RGB color space.
Additionally, there is no existing solution to render AIS objects on a GPU and thus existing GPU solutions are limited to rendering knockout groups without AIS, i.e., without an ability address “opacity coverage” within the knockout group as described above. This forces use of scanline algorithms by a conventional CPU to render AIS objects by a computing device, which suffer from poor computational performance.